To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
>Mail*LinkĀ® SMTP RE>Modal Dialogs: Part I
>
>>I followed the example of ODFForm's Password dialog to create a text entry
>>dialog. The action of the dialog when the "OK" button is hit is to post an
>>undoable command.
>>
>>So the question is, is it OK to pass the dialog's frame to the FW_CCommand
>>constructor? The frame will be destroyed when the dialog closes, right? But
>>this seems to work - I guess I'm wondering what that parameter and the
>>fFrame data member of FW_CCommand are all about. Comments?
>
>The fFrame data member of a command represents the display frame that is
>affected by the change. In the case of a dialog you shouldn't pass the
>dialog frame to the command unless the command is undoable while the
>dialog is open. In your case fFrame is apparently not used in your UndoIt
>and RedoIt methods, so you're getting away with it.
>
>Mary Boetcher
>ODF person
>
Don't forget also that when opening a dialog you should mark the undo stack. When the dialog goes away you need to clear the undo stack using the previous mark. Command that were executed while the dialog was opened should not be undoable anymore.